<script>
import _ from 'lodash'
import dataObjectConf from '../data-object-conf.js'
import { getUiItemExtraForEditable, generateOperateButtons } from '../mixins.js'

export default {
  name: 'ChartAdapter',
  props: [
    'setting',
    'editable',
    'selected'
  ],
  functional: true,
  render (h, context) {
    const editable = context.props.editable
    const extra = editable
      ? generateOperateButtons(h, context)
      : []
    return h('div', getUiItemExtraForEditable(context), [
      h('WidgetChart', {
        props: {
          setting: context.props.setting,
          editable: context.props.editable
        }
      }),
      ...extra
    ])
  }
}
</script>
